<!DOCTYPE html>
<html>


<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>孩子abo血型计算器</title>
    <style>
        /* 整体页面布局样式 */
        body {
            font-family: Arial, sans-serif;
            background-color: #e6f7ff;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-height: 100vh;
            margin: 0;
        }


        h1 {
            font-size: 24px;
            color: #007BFF;
            margin-bottom: 20px;
            font-weight: bold;
        }


        /* 选择框样式 */
        select {
            padding: 10px;
            margin: 15px 0;
            border: 1px solid #ccc;
            border-radius: 5px;
            width: 200px;
        }


      .container {
            text-align: center;
            background-color: white;
            padding: 40px;
            border-radius: 10px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
        }


        /* 按钮样式 */
        button {
            padding: 10px 20px;
            background-color: #007BFF;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            transition: background-color 0.3s, transform 0.2s;
        }


        button:hover {
            background-color: #0056b3;
            transform: scale(1.05);
        }


        button:active {
            background-color: #003d80;
            transform: scale(0.98);
        }


        /* 结果显示区域样式 */
        #result {
            margin-top: 20px;
            font-size: 18px;
            color: #333;
            background-color: #f9f9f9;
            padding: 15px;
            border-radius: 5px;
            border: 1px solid #e0e0e0;
        }
    </style>
    <script>
        function chakanjieguo() {
            let xx1 = document.querySelector("#xuexing1").value;
            let xx2 = document.querySelector("#xuexing2").value;
            let result = "";
            if (xx1 == "A" && xx2 == "A") {
                result = "你孩子的血型是A型或者是O型";
            } else if ((xx1 == "A" && xx2 == "B") || (xx1 == "B" && xx2 == "A")) {
                result = "你孩子的血型是AB型或者是B型或是A型或o型";
            } else if ((xx1 == "A" && xx2 == "AB") || (xx1 == "AB" && xx2 == "A")) {
                result = "你孩子的血型是AB型或者是B型或A型";
            } else if ((xx1 == "A" && xx2 == "O") || (xx1 == "O" && xx2 == "A")) {
                result = "你孩子的血型是A型或者是o型";
            } else if (xx1 == "B" && xx2 == "B") {
                result = "你孩子的血型是B型或O型";
            } else if ((xx1 == "B" && xx2 == "AB") || (xx1 == "AB" && xx2 == "B")) {
                result = "你孩子的血型是B型或AB型或A型";
            } else if (xx1 == "B" && xx2 == "O") {
                result = "你孩子的血型是B型或o型";
            } else if (xx1 == "AB" && xx2 == "AB") {
                result = "你孩子的血型是AB型或A型或B型";
            } else if (xx1 == "AB" && xx2 == "O") {
                result = "你孩子的血型是A型或B型";
            } else if (xx1 == "O" && xx2 == "O") {
                result = "你孩子的血型是O型";
            } else {
                result = "你输入的血型有误，请重新输入";
            }
            document.querySelector("#result").innerHTML = result;
        }
    </script>
</head>


<body>
    <h1>孩子abo血型计算器</h1>
    <div class="container">
        你的血型是：
        <p>
        <select name="" id="xuexing1">
            <option value="A">A型</option>
            <option value="B">B型</option>
            <option value="AB">AB型</option>
            <option value="O">O型</option>
        </select>
        <br>
        <select name="" id="xuexing2">
            <option value="A">A型</option>
            <option value="B">B型</option>
            <option value="AB">AB型</option>
            <option value="O">O型</option>
        </select>
    </p>
        <br>
        <button onclick="chakanjieguo()">计算结果</button>
        <div id="result">


        </div>
    </div>
    <h6><span>&copy; 2024 @小李不讲理</span></h6>
</body>


</html>